<template>
  <div class="app-container">
    <el-form :inline="true" :model="searchFrom" class="demo-form-inline">
      <el-form-item label="代码">
        <el-input v-model="searchFrom.diffValue" placeholder="code" :clearable="true"></el-input>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="buttonCloseList">查询</el-button>
      </el-form-item>
    </el-form>

    <el-table
      ref="multipleTable"
      :data="tableData"
      border
      class="table"
      header-cell-class-name="table-header">
      <el-table-column label="代码" width="100" >
        <template scope="scope">
          <span v-if="scope.row.collect==0" @click="collect(scope.row,1)">{{scope.row.symbol}}<i class="el-icon-star-off" style="padding-left: 10px;"></i></span>
          <span v-if="scope.row.collect==1" @click="collect(scope.row,0)">{{scope.row.symbol}}<i class="el-icon-star-on" style="padding-left: 10px;"></i></span>
        </template>
      </el-table-column>
      <el-table-column prop="name" label="名称" width="150" />
      <el-table-column prop="close" label="Close" width="100" />
      <el-table-column prop="industry" label="类型" width="150" />
      <el-table-column label="日底部" width="150">
        <template scope="scope">
          <el-input
            size="mini"
            v-if="scope.row.edit"
            v-model="scope.row.day_jetton"
            @change="changeDayJetton(scope.$index,scope.row)"
            @blur="changeDayJetton(scope.$index,scope.row)"/>
          <span v-else @click="editDayJetton(scope.$index,scope.row)">{{scope.row.day_jetton}}</span>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
import axios from "axios";

export default {
  name: "buttonClose",
  data() {
    return {
      tableData: [],
      searchFrom:{
        diffValue:0.8,
      }
    }
  },
  computed: {

  },
  created() {
    this.buttonCloseList()
  },
  methods: {
    buttonCloseList() {
      axios.get('/tushare/getButtonClose', {
        params: {
          diffValue:this.searchFrom.diffValue,
        }
      })
        .then((response) => {
          if (response.data.code == 0) {
            this.tableData = response.data.data
          }
        })
        .catch(function(error) {
          console.log(error)
        })
    },
  }
}
</script>

<style scoped>

</style>
